home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / wwindow2.arc / WINDOW.DOC < prev    next >
Encoding:
Text File  |  1986-08-11  |  3.3 KB  |  153 lines

  1. Copyright 1986 by   Nourse, Gregg & Browne, Inc.
  2.                     1 Horizon Rd. #612
  3.                     Fort Lee, NJ 07024
  4.  
  5. PLEASE keep the above text with this file !
  6.  
  7. /* ----------------------------------------------------------------- */
  8. /* ----------------------------------------------------------------- */
  9.  
  10.  
  11.     Window
  12.  
  13. Window is simple and easy to use (ie. there's not much to it)
  14.  
  15. up to 31 windows can be open at once.
  16.  
  17. /* ----------------------------------------------------------------- */
  18.  
  19.  
  20. to open a window call from your Lattice C program, code as follows:
  21.  
  22.  
  23.  
  24. window_handle = wopen(top,left,bottom,right,attr,title);
  25.  
  26.  
  27.  
  28.     int window_handle;
  29.  
  30.     int top, left, bottom, right, attr;
  31.  
  32.     char *title;
  33.  
  34.  
  35.         (note: 'title' can be NULL if no title is wanted)
  36.  
  37. /* ----------------------------------------------------------------- */
  38.  
  39. to close a window:
  40.  
  41.  
  42.  
  43.     wclose(window_handle);
  44.  
  45.  
  46.         int window_handle;
  47.  
  48.  
  49.  
  50. /* ----------------------------------------------------------------- */
  51.  
  52. to send text to a window:
  53.  
  54.  
  55.     wprint(window_handle,text);
  56.  
  57.  
  58.         int window_handle;
  59.  
  60.         char *text;
  61.  
  62.  
  63.  
  64.     Note: The following special characters are processed:
  65.  
  66.         CR    ( move cursor to left side of window )
  67.         LF    ( move cursor down 1 line, scroll if necessary )
  68.         BS    ( move cursor 1 position to the left )
  69.  
  70. /* ----------------------------------------------------------------- */
  71.  
  72. to position the cursor of a window (each window has it's own):
  73.  
  74.     wlocate(window_handle,row,col) /* move cursor relative to origin */
  75.  
  76.  
  77.     int    window_handle,    /* the handle from wopen() */
  78.  
  79.         row,        /*  the relative row (from 0) */
  80.  
  81.         col;        /*  the relative column (from 0) */
  82.  
  83.  
  84. /* ----------------------------------------------------------------- */
  85.  
  86. to print text at a location within a window
  87.  
  88.     this is just a wlocate() and a wprint() inside,
  89.     but you might find it usefull...
  90.  
  91.     wsay(window_handle,row,col,text)  /* move corsor + print text */
  92.  
  93.  
  94.     int    window_handle,    /* the handle from wopen() */
  95.  
  96.         row,        /* row to move cursor to */
  97.  
  98.         col;        /* columne to move cursor to */
  99.  
  100.     char *text;        /* text to print at that location */
  101.  
  102.  
  103. /* ----------------------------------------------------------------- */
  104.  
  105. to input a character string at a window location:
  106.  
  107.  
  108.     winput(window_handle,row,col,field,len) /* input text from window */
  109.  
  110.  
  111.     int    window_handle,    /* handle from wopen() */
  112.  
  113.         row,    /* row to input from */
  114.  
  115.         col,    /* column to input from */
  116.  
  117.         len;    /* max length of input field */
  118.  
  119.     char *field;    /* default read from, and input put into here */
  120.  
  121.  
  122.  
  123. /* ----------------------------------------------------------------- */
  124.  
  125. to select from a list of choices:
  126.  
  127.     wselect(window_handle,row,col,field,list) /* select from a list */
  128.  
  129.  
  130.     int window_handle,    /* handle from wopen() */
  131.  
  132.         row,col;    /* window relative position */
  133.  
  134.     char    *field,        /* copy of selection put here */
  135.  
  136.         *list[];    /* vector of strings of selections */
  137.  
  138.  
  139. the list[] above could be coded like this:
  140.  
  141. static char *choice_list[] = {
  142.     "Red",
  143.     "Blue",
  144.     "Green",
  145.     "Yellow",
  146.     "White",
  147.     "Black",
  148.     NULL};        <=== Note: last entry is NULL
  149.  
  150. /* ----------------------------------------------------------------- */
  151.  
  152. /* ----------------------------------------------------------------- */
  153.